package mammuthus.controller.filter

import net.csdn.modules.http.ApplicationController
import net.csdn.ServiceFramwork


/**
 * 5/27/15 WilliamZhu(allwefantasy@gmail.com)
 */
trait TokenAuthFilter {
  this: ApplicationController =>
  def auth() = {
    if (ServiceFramwork.mode == ServiceFramwork.Mode.production) {
      if (param("auth_token", "").isEmpty || param("auth_token") != "f9479ccf304ea4b7c853ef1d3006be67")
        render(403, "token needed")
    }
  }
}
